﻿namespace FFF.Test.Application.Events
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Abp.Dependency;
    using Abp.Events.Bus;
    using Abp.Events.Bus.Handlers;

    /// <summary>
    /// 事件处理者1
    /// </summary>
    public class TestEventHandler : IEventHandler<TestEventData>, ITransientDependency
    {
        /// <summary>
        /// 处理事件
        /// </summary>
        /// <param name="eventData">事件对象</param>
        public void HandleEvent(TestEventData eventData)
        {
            Console.WriteLine("A task is completed by id = " + eventData.TaskId);
        }
    }

    /// <summary>
    /// 事件处理者2
    /// </summary>
    public class TestEventHandler2 : IEventHandler<TestEventData>, ITransientDependency
    {
        /// <summary>
        /// 处理事件
        /// </summary>
        /// <param name="eventData">事件对象</param>
        public void HandleEvent(TestEventData eventData)
        {
            Console.WriteLine("A task is completed by id = " + eventData.TaskId);
        }
    }

    /// <summary>
    /// 测试事件参数
    /// </summary>
    public class TestEventData : EventData
    {
        /// <summary>
        /// 任务Id
        /// </summary>
        public int TaskId { get; set; }
    }
}
